
Private Sub button1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles button1.Click
        Dim b, fname, nextline As String
        Dim recordNumber As Integer
'Write WriteLineд3ݵfile.txtļУͼ6-2ʾ
        fname = "file.txt"
        FileOpen(1, fname, OpenMode.Output)
        For recordNumber = 1 To 3              'ѭ5
            nextline = "Name " & recordNumber   'ַ
            Write (1, nextline)                 'ַnextlineдļ󲻻
            WriteLine(1, recordNumber)    'recordNumberдļٻ
        Next
        FileClose(1)
'Inputfile.txtеݵıʾͼ6-3ǰ3У
        TextBox1.Text = "" 
        FileClose(1)
        FileOpen(1, fname, OpenMode.Input)
        b = ""
        Do Until EOF(1)
            Input(1, nextline)                        	'һֶεnextline
            b = b & nextline & Chr(13) & Chr(10)  
'ֶӵbв1سз  
        Loop
        FileClose(1)
        TextBox1.Text = b   
'LineInputٶfile.txtеݵıʾͼ6-3ĺ3У                                        
        FileOpen(1, fname, OpenMode.Input)
        b = ""
        Do Until EOF(1)
            nextline = LineInput(1)                		 'һַnextline
            b = b & nextline & Chr(13) & Chr(10) 
'ַӵbв1سз
        Loop
        FileClose(1)
        TextBox1.Text = TextBox1.Text & b
End Sub

